﻿package components.display
{
    import flash.display.Graphics;
    import flash.display.Shape;


    public class Rect extends Shape
    {
        private var _width:int; //넓이
        private var _height:int; //높이
        private var _fillColor:uint = 0xFF6600;
        private var _fillAlpha:Number = 1;

        public function Rect(width:int = 100, height:int = 100)
        {
            _width = width;
            _height = height;

            draw();
        }

        private function draw():void
        {
            var graphics:Graphics = this.graphics;
            graphics.clear();
            graphics.beginFill(_fillColor, _fillAlpha);
            graphics.drawRoundRect(0, 0, _width, _height, _width, _width);
            graphics.endFill();
        }

        public function set fillColor(value:uint):void
        {
            _fillColor = value;
            draw();
        }

        public function set fillAlpha(value:Number):void
        {
            _fillAlpha = value;
            draw();
        }
    }
}